home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / security / Watcher / chk_rel_item.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-07-14  |  894 b   |  36 lines

  1. /*
  2.    check_rel_item: find the part of the line corresponding to check.
  3.    Also find the previous results corresponding to the key for this line
  4.    (if any).  Pass all of this to check_item
  5.  
  6.    Kenneth Ingham
  7.  
  8.    Copyright (C) 1988 The University of New Mexico
  9. */
  10.  
  11. #include "defs.h"
  12.  
  13. check_rel_item(prev_res, rel_fmt, key_val, line, cf, cmd_name, hf)
  14. struct old_cmd_st *prev_res;
  15. struct rel_out_st *rel_fmt;
  16. char *key_val, *line;
  17. struct change_fmt_st *cf;
  18. char *cmd_name;
  19. FILE *hf;
  20. {
  21.     struct everything *prev_value;
  22.     char tchar();
  23.     char value[MAX_STR];
  24.  
  25.     find_prev_value(prev_res, rel_fmt->name, key_val, &prev_value);
  26.     if (get_rel_field(line, rel_fmt->field, value) != NULL)
  27.         check_item(cf, value, cmd_name, line, prev_value);
  28.     
  29.     /*
  30.        save the value in the history file for future comparisons.
  31.     */
  32.     if (*key_val)
  33.         fprintf(hf, "\t\t%s %c %s\n", cf->name, tchar(rel_fmt->type),
  34.             value);
  35. }
  36.